<template>
  <div class="all">
    <van-nav-bar
      class="head"
      title="零食榜单"
      left-text=""
      left-arrow
      @click-left="onClickLeft"
    />
    <van-grid>
      <van-grid-item @click="tiaozhuan1">
        <div class="pic">
          <img src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.yzcdn.cn%2Fupload_files%2F2016%2F05%2F07%2F146258897889374831.gif%3FimageView2%2F2%2Fw%2F580%2Fh%2F580%2Fq%2F75%2Fformat%2Fgif&refer=http%3A%2F%2Fimg.yzcdn.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1642831582&t=dabf2e0c00ac96029b914148fdde802d" alt="" width="100%" />
        </div>
        <p>2019零食排名由你决定</p>
        <span
          >零食其实也是快速消费品的一类，是在人们闲暇、休息时所吃的食品。最贴切的解释是吃着玩的食品．主要分类有：酸角糕，干果，膨化食品，糖果，肉制品等．随着生活水平的提高，休闲食品一直深受广大人民群众喜爱的食品。......</span
        >
      </van-grid-item>
    </van-grid>
    <div>
      <van-row
        type="flex"
        class="van_row_item"
        v-for="(item, index) in list"
        :key="index"
      >
        <van-col span="5"
          ><van-image class="van-image" :src="item.src"
        /></van-col>
        <van-col span="13" class="van_col_p">
          <p style="font-size: 14px">{{ item.name }}</p>
          <p class="van_p van-multi-ellipsis--l2">
            {{ item.content }}
          </p></van-col
        >
        <van-col span="5" class="van_vol_item">
          <!-- <van-button type="info" class="van_bottom">圆形按钮</van-button> -->
          <van-cell @click="showPopup" title="为TA助力"></van-cell>
          <p>{{ item.number }}</p>
        </van-col>
      </van-row>
      <van-popup
        v-model="show"
        class="box"
        closeable
        close-icon="close"
        :lock-scroll="false"
      >
        <div class="inBox">
          <div style="font-size: 22px">
            <p>呼朋唤友来加油</p>
            <p>分享加油得积分</p>
          </div>
          <van-image
            round
            style="margin: 0"
            src="https://img01.yzcdn.cn/vant/cat.jpeg"
            class="image_1"
          />
          <p>任同学^^^Andy</p>
          <div>
            <van-row class="middle">
              <van-col :span="6"
                ><van-image
                  src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.zhaoshang800.com%2Fimages%2Fnews%2F2016-04-06%2F14599235537.jpg&refer=http%3A%2F%2Fwww.zhaoshang800.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1642816419&t=5d82026f6ca5c41df2ca39e96629532a"
                  class="image_2"
                />
              </van-col>
              <van-col :span="18">
                <p>良品铺子</p>
                <p>
                  良品铺子为国内知名零食品牌，创立于2015年，总部位于湖北省武汉市...
                </p>
              </van-col>
            </van-row>
          </div>
          <van-image
            src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fgw.alicdn.com%2Ftfscom%2Ftuitui%2Fimg.alicdn.com%2Ftfscom%2Fi2%2F619123122%2FTB2L3RzfiqAXuNjy1XdXXaYcVXa_%21%21619123122.jpg&refer=http%3A%2F%2Fgw.alicdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1642816452&t=6a07ec199ff4941fe26128e9ea713788"
            class="image_3"
          />
          <van-button type="primary" size="large" class="van-b"
            >邀请好友一起来加油</van-button
          >
        </div>
        <van-tabbar v-model="active">
          <van-tabbar-item icon="wap-home">首页</van-tabbar-item>
          <van-tabbar-item icon="orders-o">评分评价</van-tabbar-item>
          <van-tabbar-item icon="share">助力分享</van-tabbar-item>
        </van-tabbar>
      </van-popup>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      list: [
        {
          name: "猪肉脯",
          src: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.yweidao.com%2Fsc_upload%2F59524%2Fgoods%2F20170227%2Fmiouxcbq8891488172762141_l.jpg&refer=http%3A%2F%2Fimg.yweidao.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1642816676&t=7ee9a524e6038274c7d810596fa5aec9",
          content:
              "【良品铺子】金牌肉松饼 传统零食糕点点心特产零食肉松饼......",
          number: "8256",
        },
        {
          name: "鱼丸",
          src: "https://img1.baidu.com/it/u=1381563892,1813932152&fm=26&fmt=auto",
          content:
              "【良品铺子】金牌肉松饼 传统零食糕点点心特产零食肉松饼......",
          number: "8000",
        },
        {
          name: "肉松饼",
          src: "https://img0.baidu.com/it/u=3952764808,2469990939&fm=26&fmt=auto",
          content:
            "【良品铺子】金牌肉松饼 传统零食糕点点心特产零食肉松饼......",
          number: "7800",
        },
        {
          name: "海苔吐司",
          src: "https://img1.baidu.com/it/u=3551214772,3813189533&fm=26&fmt=auto",
          content:
             "【良品铺子】金牌肉松饼 传统零食糕点点心特产零食肉松饼......",
          number: "7500",
        },
        {
          name: "牛肉粒",
          src: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fa.vpimg2.com%2Fupload%2Fmerchandise%2Fpdc%2F188%2F418%2F4201934798762418188%2F2%2FZH11055001-1.jpg&refer=http%3A%2F%2Fa.vpimg2.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1642816900&t=6c4b097fc2bde283426c48a0f0fd71cf",
          content:
              "【良品铺子】金牌肉松饼 传统零食糕点点心特产零食肉松饼......",
          number: "7100",
        },
        {
          name: "鸡蛋干",
          src: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20180922%2F59b04bf13c534b40b69091102ef873e0.jpeg&refer=http%3A%2F%2F5b0988e595225.cdn.sohucs.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1642816790&t=03c31111a1ecb3c790340bce5421f45d",
          content:
            "【良品铺子】金牌肉松饼 传统零食糕点点心特产零食肉松饼......",
          number: "7001",
        },
      ],
      show: false,
      active: 0,
    };
  },
  methods: {
    tiaozhuan1() {
      this.$router.push({ path: "/" }).catch((error) => error);
    },
    showPopup() {
      this.show = true;
    },

    onClickLeft() {
      this.$router.push({ path: "/NPSmouth" }).catch((error) => error);
    },
  },
};
</script>
<style scoped lang="less">
.all {
  padding-bottom: 73px;
}
.head {
  width: 100%;
  height: 51px;
  color: rgba(80, 80, 80, 1);
  background-color: rgba(239, 239, 239, 1);
  position: fixed;
  top: 0;
}
/deep/.van-nav-bar .van-icon {
  color: rgba(153, 153, 153, 1);
}
/deep/.van-nav-bar__title {
  color: rgba(42, 131, 78, 1);
  font-size: 18px;
}
.van-grid {
  width: 358px;
  height: 100%;
  .van-grid-item {
    width: 358px;
    height: 290px;
    color: rgba(250, 250, 250, 1);
    background-color: rgba(250, 250, 250, 1);
    font-size: 16px;

    box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.5);
    margin-top: 10px;
    margin-left: 9px;
    .pic {
      width: 358px;
      height: 184px;
      overflow: hidden;
    }
    p {
      position: absolute;
      left: 17px;
      top: 107px;
      color: rgba(255, 255, 255, 1);
      text-shadow: rgba(0, 0, 0, 0.5) 0px 2px 2px;
      font-size: 23px;
    }
    span {
      width: 324px;
      height: 74px;
      left: 28px;
      top: 261px;
      color: rgba(0, 0, 0, 0.8700000048);
      font-size: 13px;
      line-height: 170%;
      text-align: left;
      padding: 20px;
    }
  }
}
.van_row_item {
  border-bottom: 1px solid rgba(166, 166, 166, 1);
  .van_vol_item {
    .van-cell {
      width: 60px;
      height: 20px;
      font-size: 2px;
      padding: 0;
      background-color: rgba(42, 131, 78, 1);
      text-align: center;
      color: rgba(255, 255, 255, 1);
      border-radius: 10px;
      margin-left: 23px;
      margin-top: 33px;
    }
    p {
      color: rgba(80, 80, 80, 1);
      font-size: 10px;
      text-align: center;
      margin-left: 20px;
    }
  }

  .van_col_p {
    margin-top: 18px;
    p {
      margin: 0;

      font-size: 12px;
    }
    .van_p {
      margin-top: 10px;
      width: 100%;
      -webkit-line-clamp: 2;
      white-space: wrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
}
.middle {
  margin: 0 auto;
  width: 280px;
  height: 100px;
  border: 1px solid;
  padding: 0px;
  text-align: left;
  border-radius: 10px;
  p:first-child {
    // float: left;
    font-size: 14px;
    margin-left: 10px;
  }
  p:nth-child(2) {
    margin-left: 10px;
    font-size: 12px;
    padding-top: -9px;
  }
}
.van-image {
  width: 64px;
  height: 64px;
  margin-left: 10px;
  margin-top: 20px;
}
.van-b {
  width: 284px;
  height: 48px;
  background-color: rgba(42, 130, 78, 1);
  border-radius: 8px;
  font-size: 14px;
}
.box {
  width: 375px;
  height: 100%;
  color: rgba(80, 80, 80, 1);
  background-color: rgba(80, 80, 80, 1);
  font-size: 14px;
  line-height: 150%;
  text-align: center;
  .inBox {
    position: fixed;
    left: 19px;
    top: 5px;
    width: 338px;
    height: 530px;
    color: rgba(80, 80, 80, 1);
    background-color: rgba(255, 255, 255, 1);
    border-radius: 11px;
    text-align: center;
    .image_1 {
      width: 66px;
      height: 66px;
    }
    .image_2 {
      width: 64px;
      height: 64px;
    }
    .image_3 {
      width: 120px;
      height: 120px;
    }
  }
  /deep/.van-popup__close-icon--top-right {
    right: 25px !important;
  }
}
</style>
